import request from '@/utils/request'

// 租赁订单列表
export async function backendOrderList(params: any) {
  return request('/api/platform/backendOrderList', {
    method: 'GET',
    params
  })
}

// 电商订单列表
export async function ecommerceOrderList(params: any) {
  return request('/api/platform/ecommerceOrderList', {
    method: 'GET',
    params
  })
}

// 电商状态订单数量
export async function ecommerceOrderCount(params: any) {
  return request('/api/platform/ecommerceOrderCount', {
    method: 'GET',
    params
  })
}

// 获取脱敏数据
export async function showPrivacy(data: any) {
  return request('/api/platform/showPrivacy', {
    method: 'POST',
    data
  })
}

// 各状态订单数量
export async function orderNumberCount(params: any) {
  return request('/api/platform/orderNumberCount', {
    method: 'GET',
    params
  })
}

// 渠道列表
export async function getShareLinkMap() {
  return request('/api/platform/getShareLinkMap', {
    method: 'GET'
  })
}

// 查看备注记录
export async function getRemarkList<T>(params: T) {
  return request('/api/platform/getRemarkList', {
    method: 'GET',
    params
  })
}

// 添加备注
export async function addRemark<T>(data: T) {
  return request('/api/platform/addRemark', {
    method: 'POST',
    data
  })
}

// 押金解冻
export async function depositThaw(data: { order_sn: string }) {
  return request('/api/platform/depositThaw', {
    method: 'POST',
    data
  })
}

// 退还押金
export async function refundDeposit(data: { order_id: string }) {
  return request('/api/platform/refundDeposit', {
    method: 'POST',
    data
  })
}

// 押金转支付
export async function depositTransferPay(data: { order_id: string }) {
  return request('/api/platform/depositTransferPay', {
    method: 'POST',
    data
  })
}

// 删除订单
export async function deleteOrders(data: { order_id: string }) {
  return request('/api/platform/deleteOrders', {
    method: 'POST',
    data
  })
}

// 关闭订单
export async function closeOrders(data: { order_id: string }) {
  return request('/api/platform/closeOrders', {
    method: 'POST',
    data
  })
}

// // 强制关闭订单
// export async function depositTransferPay(data: { order_id: string }) {
//   return request('/api/platform/depositTransferPay', {
//     method: 'POST',
//     data,
//   });
// }

// 查看物流
export async function adminLookExpress(params: { id: string | number; type: string | number }) {
  return request('/api/platform/adminLookExpress', {
    method: 'GET',
    params
  })
}

// 获取逾期金额
export async function getOverdueMoney(params: any) {
  return request('/api/platform/getOverdueMoney', {
    method: 'GET',
    params
  })
}

// 处理售后
export async function dealAfterSale(data: { order_id: string; type: string; reject_reason?: string }) {
  return request('/api/platform/dealAfterSale', {
    method: 'POST',
    data
  })
}

// 获取订单用户申请售后的原因
export async function getAfterSaleRejectReason(params: any) {
  return request('/api/platform/getAfterSaleRejectReason', {
    method: 'GET',
    params
  })
}

// 获取物流公司
export async function expressCompany(params: any) {
  return request('/api/applet/expressCompany', {
    method: 'GET',
    params
  })
}

// 发货
export async function addExpress(data: any) {
  return request('/api/merchant/addExpress', {
    method: 'POST',
    data
  })
}

// 获取业务员列表
export async function getShopSalesMan(params: any) {
  return request('/api/platform/getShopSalesMan', {
    method: 'GET',
    params
  })
}

// 订单分配
export async function allocateOrders(data: any) {
  return request('/api/backend/allocateOrders', {
    method: 'POST',
    data
  })
}

// 修改物流
export async function updateExpress(data: any) {
  return request('/api/merchant/updateExpress', {
    method: 'POST',
    data
  })
}

// 获取当前渠道
export async function getChannels() {
  return request('/api/backend/getChannels', {
    method: 'GET'
  })
}

// 电商退款
export async function refundSfAmount(data: any) {
  return request('/api/merchant/refundSfAmount', {
    method: 'POST',
    data
  })
}

// 子店铺选项列表接口
export async function getSubShopOptions(params: any) {
  return request('/api/backend/getSubShopOptions', {
    method: 'GET',
    params
  })
}

// 动态获取审核员列表
export async function getOrderAuditors(params: any) {
  return request('/api/backend/getOrderAuditors', {
    method: 'GET',
    params
  })
}

// 订单分配给子店铺
export async function allocateToSubShop(data: any) {
  return request('/api/backend/allocateToSubShop', {
    method: 'POST',
    data
  })
}

// 获取所有审核员列表
export async function getAllAuditors(params: any) {
  return request('/api/backend/getAllAuditors', {
    method: 'GET',
    params
  })
}

// 自提验证
export async function deliveryVerify(data: any) {
  return request('/api/platform/deliveryVerify', {
    method: 'POST',
    data
  })
}

//生成微信url
export function wxGenerateScheme(data: any) {
  return request('/api/front/wxGenerateScheme', {
    method: 'POST',
    data
  })
}

// 优惠券信息列表
export async function orderVoucherList(params: any) {
  return request('/api/backend/orderVoucherList', {
    method: 'GET',
    params
  })
}

//生成微信url
export function lookExpress(data: any) {
  return request('/api/front/lookExpress', {
    method: 'POST',
    data
  })
}

//解约审核接口
export function unsignContractPay(data: any) {
  return request('/api/platform/unsignContractPay', {
    method: 'POST',
    data
  })
}

// 改价格
export function alterOrderPrice(data: any) {
  return request('/api/platform/alterOrderPrice', {
    method: 'POST',
    data
  })
}

// 获取新、老征信开关
export function getPlatformCreditType() {
  return request('/api/credit/getPlatformCreditType', {
    method: 'GET'
  })
}

// 增值服务列表
export async function getListForAmendOrder(params: any) {
  return request('/api/platform/getListForAmendOrder', {
    method: 'GET',
    params
  })
}

//生成补订单付款码
export function submitAmendOrder(data: any) {
  return request('/api/backend/submitAmendOrder', {
    method: 'POST',
    data
  })
}

// 到期账单
export function getExpiredBillsData(data: any) {
  return request('/api/platform/getExpiredBillsData', {
    method: 'POST',
    data
  })
}

// 到期账单角标数量统计
export function getExpiredBillsDataCount(data: any) {
  return request('/api/platform/getExpiredBillsDataCount', {
    method: 'POST',
    data
  })
}